package org.piggy.client.controller;

import org.piggy.api.server.TestService;
import org.piggy.common.anno.RemoteInvoke;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.ArrayList;
import java.util.List;

@Controller
public class TryController {

    @RemoteInvoke
    private TestService userService0;

    @RemoteInvoke
    private TestService userService1;

    @ResponseBody
    @GetMapping("/try1")
    public Object test1(){
        List<String> list = new ArrayList<>();
        list.add("123");
        list.add("asd");
        return userService0.test1("piggy", list,666);
    }

    @ResponseBody
    @GetMapping("/try2")
    public Object test2(){
        return userService1.test2("1");
    }

}
